﻿using AnesSystem.Models;
using AnesSystem.ViewModels.WorkScore;
using Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AnesSystem.Controls
{
    /// <summary>
    /// WorkScoreStatistics.xaml 的交互逻辑
    /// </summary>
    public partial class WorkScoreDetailsTableCtrl :CustomCommonTableCtrl
    {
        public WorkScoreDetailsTableCtrl()
        {
            InitializeComponent();
            this.DataContext = WorkScoreDetailsCtrlViewMode.Instance;
            this.Loaded += WorkScoreDetailsTableCtrl_Loaded;
        }

        //刷新
        private void WorkScoreDetailsTableCtrl_Loaded(object sender, RoutedEventArgs e)
        {
            InterfaceAssignment(WorkScoreDetailsCtrlViewMode.Instance.Calculation());
        }

        //private void seach_Click(object sender, RoutedEventArgs e)
        //{
        //    InterfaceAssignment(WorkScoreDetailsCtrlViewMode.Instance.Calculation());
        //}

        public override void Refesh()
        {
            InterfaceAssignment(WorkScoreDetailsCtrlViewMode.Instance.Calculation());
        }
        private void InterfaceAssignment(GongFenZhiBiaoRCModel gongFenZhiBiaoRC)
        {
            if (gongFenZhiBiaoRC !=null)
            {
                total.Text = gongFenZhiBiaoRC.Total.ToString();
                qsmz.Text = gongFenZhiBiaoRC.QuanMaDanQiang.ToString();
                ymwmz.Text = gongFenZhiBiaoRC.YingMoWai.ToString();
                jbmz.Text = gongFenZhiBiaoRC.JuBuMaZui.ToString();
                sjzzmz.Text = gongFenZhiBiaoRC.ShenJingZuZhi.ToString();
                shzt.Text = gongFenZhiBiaoRC.ShuHouZhenTong.ToString();
                dyjs.Text = gongFenZhiBiaoRC.NianLingDaYuJiuShi.ToString();
                dybs.Text = gongFenZhiBiaoRC.NianLingDaYuBaShi.ToString();
                dyqs.Text = gongFenZhiBiaoRC.NianLingDaYuQiShi.ToString();
                xyses.Text = gongFenZhiBiaoRC.NianLingXiaoYuShier.ToString();
                xyls.Text = gongFenZhiBiaoRC.NianLingXiaoYuLiu.ToString();
                ycxy.Text = gongFenZhiBiaoRC.YouChuangXueYaJianCe.ToString();
                mzsd.Text = gongFenZhiBiaoRC.MaZuiShenDuJianCe.ToString();
                zxjmcc.Text = gongFenZhiBiaoRC.ZhongXinJingMaiChuanCi.ToString();
            }
        }
    }
}
